class Point(object):
    def __init__(self, x, y):
        self.x = x
        self.y = y


class Rectangle(object):
    def __init__(self, upper_left, down_right):
        self.upper_left = upper_left
        self.down_right = down_right

    def area(self):
        return (self.upper_left.y - self.down_right.y) * (self.down_right.x - self.upper_left.x)

    def is_point_in_rectangle(self, p):
        return self.upper_left.x <= p.x <= self.down_right.x and down_right.y <= p.y <= self.upper_left.y


class Square(Rectangle):
    def __init__(self, upper_left, down_right):
        if upper_left.y - down_right.y == down_right.x - upper_left.x:
            super(Square, self).__init__(upper_left, down_right)
        else:
            print('your input is not square')


p = Point(2, 3)
upper_left = Point(1, 4)
down_right = Point(4, 1)
square = Square(upper_left, down_right)
print(square.area())
print(square.is_point_in_rectangle(p))
